# My ruby worker
def worker(req)
  # Body response
  body = %{
<!DOCTYPE html>
<head>
<title>Wasm Workers Server</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
<style>
  body { max-width: 1000px; }
  main { margin: 5rem 0; }
  h1 { margin: .5rem 0 2rem; }
  h1, p { text-align: center; }
  pre { font-size: .9rem; }
  pre > code { padding: 2rem; }
  p { margin-top: 2rem; }
</style>
</head>
<body>
<main>
  <h1>Hello from Wasm Workers Server 👋</h1>
  <pre><code>Replying to #{req.url}
Method: #{req.method}
Host header: #{req.headers["host"]}</code></pre>
  <p>
    This page was generated by a Ruby script
  </p>
</main>
</body>
  }

  # Build a new response
  res = Response.new(body)

  # Add a new header
  res.headers["x-generated-by"] = "wasm-workers-server"

  res
end
